<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>书单-Mybooks</title>
    </head>
    <body>
        <header>
            <a href="/">首页</a>
        </header>
        <input type="button" value="新增" onclick="location.href='/books/add'">
        <div th:if="#{list.isEmpty(books) == false}">
            <label> 我的书单 </label>
            <hr>
            <dl th:each="book:${books}">
                <dt><a th:href="${book.saleUrl}" th:text="${book.name}" target="_blank">购买</a></dt>
                <button th:onclick="'location.href=\'/books/edit/' + ${book.id} + '\''">编辑</button>
                <button th:onclick="'location.href=\'/books/removal/' + ${book.id} + '\''">删除</button>
                <dd th:text="${book.author}">作者</dd>
                <dd th:text="${book.description}">描述</dd>
                <dd th:text="${book.publisher}">出版设</dd>
                <hr>
            </dl>
        </div>
    </body>
</html>